{{include file="public/header" /}}

{{include file="public/header_top_nav" /}}

{{include file="public/home_search" /}}

<!--注册页面 start -不需要body -->
<!-- conntent start  -->
<div class="am-g my-content user-register-container inlineFlex alignitemcenter" {{if !empty($user_register_bg_images)}}style="min-height: 600px;background: #FAFAFA url({{:AttachmentPathViewHandle($user_register_bg_images)}});"{{/if}}>
<div class="am-container">
    <!-- 用户注册页面顶部钩子 -->
    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_user_reg_info_top</span>
    </div>
    {{/if}}
    {{if !empty($plugins_view_user_reg_info_top_data) and is_array($plugins_view_user_reg_info_top_data)}}
    {{foreach $plugins_view_user_reg_info_top_data as $hook}}
    {{if is_string($hook) or is_int($hook)}}
    {{$hook|raw}}
    {{/if}}
    {{/foreach}}
    {{/if}}

    <div class="am-u-sm-12 am-u-md-6 am-u-lg-5 am-u-sm-centered">
        <div class="register-container">
            <div class="register-top">
                {{if !empty($home_user_login_type)}}
                <span>Ya estoy registrado</span>
                <a href="{{:MyUrl('index/user/logininfo')}}" class="am-btn am-btn-secondary am-btn-xs am-radius">Inicie Sesión</a>
                {{/if}}

                <!-- 用户注册页面钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_reg_info</span>
                </div>
                {{/if}}
                {{if !empty($plugins_view_user_reg_info_data) and is_array($plugins_view_user_reg_info_data)}}
                {{foreach $plugins_view_user_reg_info_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                {{$hook|raw}}
                {{/if}}
                {{/foreach}}
                {{/if}}
            </div>

            <div class="register-content">
                {{if !empty($home_user_reg_type)}}
                <div data-am-widget="tabs" class="am-tabs am-tabs-d2" data-am-tabs="{noSwipe: 1}">
                    <ul class="am-tabs-nav am-cf">

                        {{if in_array('email', $home_user_reg_type)}}
                        <li class="{{if !in_array('username', $home_user_reg_type) and !in_array('sms', $home_user_reg_type)}}am-active{{/if}}"><a href="[data-tab-panel-2]" style="font-size: 18px">Correo Electrónico</a></li>
                        {{/if}}
                    </ul>
                    <div class="am-tabs-bd am-padding-bottom-sm">

                        {{if in_array('email', $home_user_reg_type)}}
                        <div data-tab-panel-2 class="am-tab-panel am-active{{if !in_array('username', $home_user_reg_type) and !in_array('sms', $home_user_reg_type)}}am-active{{/if}}">
                            <!-- form start -->
                            <form class="am-form form-validation-email" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
                                <div class="am-form-group am-form-group-refreshing business-form-block">
                                    <label>Correo Electrónico</label>
                                    <input type="email" name="accounts" class="am-radius" placeholder="Ingrese Su Correo Electrónico" data-validation-message="Error de formato del buzón de correo electrónico" required />
                                </div>
                                <div class="am-form-group am-form-group-refreshing business-form-block am-margin-top-xs">
                                    <label>Código de Verificación de Correo Electrónico</label>
                                    <div class="am-input-group am-input-group-sm">
                                        <input type="number" name="verify" class="am-radius" placeholder="de Verificación" minlength="4" maxlength="4" data-validation-message="验证码格式 4 位数字" required />
                                        <span class="am-input-group-btn">
                                                        <button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'Enviar...'}" data-url="{{:MyUrl('index/user/regverifysend')}}" data-verify="{{:MyC('common_img_verify_state')}}" data-text="Obtener Código de Verificación" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_interval_time', 30, true)}}" data-form-tag="form.form-validation-email">Obtener Código de Verificación</button>
                                                    </span>
                                    </div>
                                </div>
                                <div class="am-form-group am-form-group-refreshing business-form-block">
                                    <label>Nombre y Apellido</label>
                                    <input type="text" name="nickname" class="am-radius" placeholder="Escriba su Nombre" required />
                                </div>
                                <div class="am-form-group am-form-group-refreshing business-form-block">
                                    <label>Teléfono </label>
                                    <input type="text" name="mobile" class="am-radius" placeholder="Escriba su Número de Teléfono" required />
                                </div>
                                <div class="am-form-group am-form-group-refreshing business-form-block">
                                    <label>Nombre de Empresa</label>
                                    <input type="text" name="companyname" class="am-radius" placeholder="Escriba su Nombre de Empresa" required />
                                </div>
                                <div class="am-form-group am-form-group-refreshing business-form-block">
                                    <label>Escriba su Dirección de Empresa</label>
                                    <input type="text" name="address" class="am-radius" placeholder="Ingrese Dirección de Empresa" required />
                                </div>



                                <div class="am-form-group am-form-group-refreshing business-form-block am-margin-top-xs">
                                    <label>Establecer contraseña de inicio de sesión
                                    </label>
                                    <div class="am-input-group am-input-group-sm">
                                        <input type="password" name="pwd" class="am-radius" placeholder="Establecer contraseña de inicio de sesió" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="Formato criptográfico entre 6 y 18 caracteres" required />
                                        <span class="am-input-group-btn">
                                                        <button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
                                                    </span>
                                    </div>
                                </div>

                                {{if MyC('home_is_enable_userregister_agreement') eq 1}}
                                <div class="agreement am-padding-horizontal-sm">
                                    <label class="am-checkbox am-success c-p">
                                        <input type="checkbox" value="1" name="is_agree_agreement" data-validation-message="Por favor, acepte el Acuerdo de registro" data-am-ucheck required /> Lea y Acepte
                                    </label>
                                    <a href="{{:MyUrl('index/agreement/index', ['document'=>'userregister'])}}" target="_blank">《Terminos y Condiciones》</a>
                                </div>
                                {{/if}}

                                <div class="am-form-group am-form-group-refreshing business-form-block am-margin-top-sm">
                                    <input type="hidden" name="type" value="email" />
                                    <button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: 'En proceso...'}">registrado</button>
                                </div>
                            </form>
                            <!-- form end -->
                        </div>
                        {{/if}}
                    </div>
                </div>
                {{else /}}
                <div class="am-text-center am-padding-vertical-lg register-close"><i class="am-icon-warning"></i> 暂时关闭了注册</div>
                {{/if}}
            </div>
        </div>
    </div>

    <!-- 用户注册页面底部钩子 -->
    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_user_reg_info_bottom</span>
    </div>
    {{/if}}
    {{if !empty($plugins_view_user_reg_info_bottom_data) and is_array($plugins_view_user_reg_info_bottom_data)}}
    {{foreach $plugins_view_user_reg_info_bottom_data as $hook}}
    {{if is_string($hook) or is_int($hook)}}
    {{$hook|raw}}
    {{/if}}
    {{/foreach}}
    {{/if}}
</div>
</div>
<!-- conntent end  -->

<!-- 图片验证码  -->
{{if MyC('common_img_verify_state') eq 1}}
{{include file="user/images_verify" type="user_reg" /}}
{{/if}}


{{include file="public/footer_nav" /}}

{{include file="public/footer" /}}

<script type="text/javascript">
    // 注册成功回调
    function RegisterSuccessBack(e)
    {
        if(e.code == 0)
        {
            $.AMUI.progress.done();
            Prompt(e.msg, 'success');

            // 登录返回html处理
            if((e.data.body_html || null) != null)
            {
                $('body').append(e.data.body_html);
            }

            setTimeout(function()
            {
                window.location.href = '{{$referer_url}}';
            }, 1500);
        } else {
            $('.register-container form.am-form').find('button[type="submit"]').button('reset');
            $.AMUI.progress.done();
            Prompt(e.msg);
        }
    }
</script>

<!--注册页面 end -不需要body -->
